Conversation
Contributor
WalkthroughDetects whether the old PostgreSQL cluster used data checksums and passes a corresponding --data-checksums flag into initdb during upgrade initialization; also bumps three postgres_release version strings in ansible/vars.yml. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
203501d to
2720eb4
Compare
Collaborator
Author
|
Tested upgrade with various checksum/no checksum permutations, pause and restore and functionality. Ready for review and merge |
hunleyd
approved these changes
Jan 28, 2026
Contributor
|
@jchancojr take a peek? |
Collaborator
Author
|
Collaborator
Author
|
Collaborator
Author
|
3853083 to
10acb16
Compare
Crispy1975
approved these changes
Jan 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Problem
Users upgrading via Supabase UI encounter this error:
old cluster uses data checksums but the new one does not
Root Cause
Commit cf9bce1 (Nov 14, 2025) enabled data checksums for new PostgreSQL
installations, but the pg_upgrade scripts were not updated to match.
Affected Files
File: ansible/tasks/setup-postgres.yml
Has --data-checksums?: Yes
Lines: https://github.com/supabase/postgres/blob/develop/ansible/tasks/setup-postgres.yml#L232,
https://github.com/supabase/postgres/blob/develop/ansible/tasks/setup-postgres.yml#L260,
https://github.com/supabase/postgres/blob/develop/ansible/tasks/setup-postgres.yml#L277
────────────────────────────────────────
File: ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh
Has --data-checksums?: No
Lines: https://github.com/supabase/postgres/blob/develop/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh#L470,
https://github.com/supabase/postgres/blob/develop/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh#L472,
https://github.com/supabase/postgres/blob/develop/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh#L475
What Happens
The Fix
Detect whether the old cluster has checksums enabled using pg_controldata, then conditionally pass --data-checksums to initdb.
Add detection after PGDATAOLD is set (after line 244):
Check if old cluster has data checksums enabled
CHECKSUM_VERSION=$("$PGBINOLD/pg_controldata" "$PGDATAOLD" | grep -i checksum | awk '{print $NF}')
if [ "$CHECKSUM_VERSION" != "0" ]; then
CHECKSUM_FLAG="--data-checksums"
else
CHECKSUM_FLAG=""
fi
Update all three initdb calls to use $CHECKSUM_FLAG:
$PGBINNEW/initdb $CHECKSUM_FLAG --encoding=$SERVER_ENCODING --locale-provider=icu ...
$PGBINNEW/initdb $CHECKSUM_FLAG --encoding=$SERVER_ENCODING --lc-collate=...
$PGBINNEW/initdb $CHECKSUM_FLAG -L $PGSHARENEW -D $PGDATANEW/ --username=supabase_admin
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.